Expression
Recurrent Complex uses expressions (from a boolean algebra) for some of its inputs. These have special syntax, but don't worry - the built-in parser does help with finding syntax errors if it gets complicated. Boolean Expressions A boolean expression, generally, is a formula that works with booleans (that is, variables that can either be 'true' or 'false'). Operators, by order of precedence: * !''a'' '''- Not: Inverts the value (true -> false, false -> true) * ''a ''& b ''- And: Returns true if a and b are both true * a'' '|''' b'' - Or: Returns true if either a or b is true * ''a ?? b'' '::' ''c - If a, return b, otherwise returns c ('if a then b else c') * (''a) '- Parentheses: Groups the variable and validates it (like in normal algebra) '''Special Character: Quotes ""' If you need any of these characters inside a variable, use quotes. Example: "VariableWithAn&" '|''' "VariableWithQuotes()" or "Variable with spaces".'' Special Character: Backslash \ You can also use a backslash \ 'to mark the next character to be used literally instead. Example: ''VariableWithAn\& '| VariableWithQuotes\(\) |''' Variable\ with\ spaces becomes ''VariableWithAmpersand& '| 'VariableWithQuotes() '| Variable with spaces'' To use backslashes or quotes inside variable names, you can of course escape them too, e.g. VariableWithQuotes\" and VariableWithBackslash\\. Also, note that whitespace is optional and notes the beginning of the next token. Example: Some\ Variable &''' Some\ Other\ Variable becomes ''Some Variable '&''' Some Other Variable''. Global Values There are a few global values that can be used in all types of expressions. true - Always evaluates to true (constant) false - Always evaluates to false (constant) global:a ''- Evaluates the global toggle ''a. These can be set in the config file. For example, by default, the expression global:decayTreeLeaves is used in the tree transformer to determine whether tree leaves should be decayable after spawn. Types There are a lot of different types of expressions. You do not need through every single one of these - just find the type of expression you are supposed to provide in this list. Dependency Expression A dependency expressions if a thing (e.g. structure, inventory generator) will be loaded. Variable Types: * $''a'' mod:a'' - Returns true if the mod with the Mod ID 'a' is currently installed / loaded. * '#''a'' '''structure:a'' '''strc:a'' - Returns true if a structure with ID 'a' is currently loaded. * '''registry:''a.b ''reg:''a.b ''- Finds the registry with ID 'a', and evaluates the variable 'b' in it. Examples $reccomplex & mod:yegamolchattels & $pandorasbox True if the mods Recurrent Complex, Ye Gamol Chattels and Pandora's Box are all loaded. (registry:structure.has:BigHouse | registry:structure.has:SmallHouse) & !$yegamolchattels True if either the structure 'BigHouse' or 'SmallHouse' are loaded, but the mod Ye Gamol Chattels is not. $yegamolchattels & !(mod:pandorasbox | registry:inventory_generation_component.has:AbandonedChest) True if Ye Gamol Chattels is loaded, but neither Pandora's Box, nor the inventory generation component AbandondedChest are. Biome Expression A biome expression determines if a biome is matched. Y Variable Types: * a 'id=a'' - Returns true if the ID of the biome is 'a'. * '''$a 'type=a'' - Returns true if the biome matches the biome dictionary type 'a'. You can find out biome types with /#biome. * '''name=a ''- Returns true if the biome has the name 'a'. Examples '''plains | id=desert | forest' Whitelist: Matches biomes with the IDs 'Plains', 'Desert' or 'Forest'. !(type=WATER | id=forest) Blacklist: Matches all biomes except water-type biomes or 'Forest'. ($PLAINS | type=FOREST) & !id=plains Matches all plains and forest - type biomes, except the biome with the ID 'Plains' type=WATER & !($OCEAN | $SNOWY) Matches all water - style biomes, except the oceans and snowy ones. Dimension Expression A dimension expression determines if a dimension is matched. Variable Types: * $''a'' type=a'' - Returns true if the current dimension matches the dimension dictionary type 'a' * ''a 'id='''a '- Returns true if the current dimension has the id 'a'. Examples '''0 | 1 | id=-1' Whitelist: Matches dimensions 0 (overworld), 1 (the End) and -1 (nether) !(type=FINITE | id=1) Blacklist: Matches all dimensions, except finite ones and 1 (the End) ($ENDER | type=REAL) & !id=0 Matches all ender - style and real dimensions, except 0 (overworld). $HELL & !(type=FINITE | $UNREAL) Matches all hell - style dimensions, except if they are finite or unreal in nature. Block Expression / Positioned Block Expression A block expression deines if a block is matched. Variable Types: * #''a-b metadata=''a-b ''- Returns true if the metadata is within the specified range (a to b) * '''#a 'metadata='''a '- Returns true if the metadata is exactly the specified value * '''property[a'']=''b ''- Returns true if the block has the property with name a, and its value is b. * ''a ''id=''a'' - Returns true if the block has the specified ID If the expression is positioned, the following variable types are also available: * '''is:a'' - Returns true if the block matches the criteria. 'a' can be either of: leaves, air, foliage, replaceable, liquid, water, lava * '''sustains:a'' - Returns true if the block sustains a given plant type. 'a' can be either of: trees, mushrooms, cacti * '''blocks:a'' - Returns true if the block matches the given thing. 'a' can be either of: movement, light Examples '''wool | id=reccomplex:generic_space | minecraft:stone' Matches all wool, negative space and stone blocks. sustains.trees & !id=grass Matches all blocks that sustain trees, but aren't grass. is.foliage | is.replaceable | is.air Matches all blocks that are either air, replaceable, or foliage. (Useful to determine non-terrain blocks). id=wool & !(propertycolor=silver | propertycolor=red) Matches all wool blocks, except those with color silver and red. Resource Expression A resource expression deines if a resource (e.g. structure, inventory generator) is matched (e.g. should be loaded). Variable Types: *'$'a 'domain=a ''- Returns true if the resource is loaded within the specified domain (for example, a mod ID). The $ stands free if the resource has no domain (e.g. from the structures folder). *''a ''id=''a'' - Returns true if the resource has the specified ID. Examples '''MeteorSite | id=AbandonedTower | SmallPyramid Matches only the MeteorSite, AbandonedTower, and SmallPyramid structures ('Whitelist'). !MeteorSite & !AbandonedTower & !id=SmallPyramid Matches all structures except MeteorSite, AbandonedTower, and SmallPyramid ('Blacklist'). (domain=reccomplex | $) & !(MeteorSite | AbandonedTower) Matches all structures added by Recurrent Complex, and structures made by the user - except MeteorSite and AbandonedTower. Command Expression A command expression defines if a command is matched (e.g. should be executed). Variable Types: *'$'a 'name=a ''- Returns true if the executing player / block has the specified name. *#''a ''canUseLevel:a - Returns true if the executing player / block has the specified permission level Examples '''name=Ivorforce | canUseLevel:3 Only Ivorforce and any player with permission level 3 and above can use the command. !$Ivorforce & #3 Any player with permission level 3 and above can use the command, except Ivorforce. Environment Expression An environment expression defines if a certain environment matches the given criteria (e.g. biome, village type etc.). Variable Types: * biome.a ''- Followed by a biome expression variable. * '''dimension.a ''dim.''a ''- Followed by a dimension expression variable. * '''dependency.a 'dep.a ''- Followed by a dependency expression variable. * '''villagetype=a 'vtype=a ''- Returns true if the environment is a village with the specified type. Enter None to match environments outside villages. * '''generation.a'' '''gen.a '' - Followed by a structure generation info expression variable (of the generation info currently in use). * '''variable.a'' - Returns the value of one of the local variables declared for the structure. Examples '''biome.name=Plains & dim.id=0 & villagetype=None' Matches only plains biomes in the overworld, outside of villages. (biome.type=Forest & dim.id=0) | (biome.type=Snowy & dim.id=-1) Matches forests in the overworld, and snowy biomes in the nether (hah). (vtype=0 | vtype=1) & dimension.id=0 Matches regular villages and desert villages, but only in the overworld. Generation Info Expression A generation info expression defines if a generation info matches the given criteria. Variable Types: * id=a'' - Returns true if the generation info has the given id. * '$''a '' type=''a'' - Returns true if the type id of the generation info is 'a'. Examples '''type=natural & !id=natural_4d36d9d1 Matches all 'Natural'-type generation infos, except the one with ID natural_4d36d9d1. Registry Expression In Recurrent Complex, there are a bunch of registries that are referrable by the player - for example the structure registry or the item collection registry. This expression determines if a registry matches the given criteria. Variable Types: * has:a'' '#''a ''- Returns true if the registry has an entry with the id 'a'. Examples '''has:MeteorSite True if the registry has the entry MeteorSite.Category:Information Category:Beginner